// pages/myorder/myorder.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    actnum:1,
    orderlist:[
      {
        shopname:'店铺名称',
        zhuangtai: 1,
        num: 2,
        zj: '39.9',
        ordercode:'153146582952659',
        productlist:[
          {img:'../../resource/image/cp1.jpg',name:'商品名称',ms:'商品描述',price:'399.99',maxprice:'599.99',sl:'1'},
          { img: '../../resource/image/cp1.jpg', name: '商品名称', ms: '商品描述', price: '399.99', maxprice: '599.99', sl: '1' }
        ]
      },
      {
        shopname: '店铺名称',
        zhuangtai: 4,
        num: 1,
        zj: '39.9',
        ordercode: '153146582952659',
        productlist: [
          { img: '../../resource/image/cp1.jpg', name: '商品名称', ms: '商品描述', price: '399.99', maxprice: '599.99', sl: '1' }
        ]
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    actnumbtn:function(e){
      this.setData({ 'actnum': e.target.dataset.index})
    },
    delorder:function(e){
     var that = this;
      wx.showModal({
        title: '提示',
        content: '你确定要删除该订单吗？',
        success: function (res) {
          if (res.confirm) {
            var orderlistt = that.data.orderlist;
            orderlistt.splice(e.target.dataset.index,1)
            that.setData({ 'orderlist': orderlistt})
          } else if (res.cancel) {
            
          }
        }
      })
    }
  }
})
